<div class="title">根据联系人姓名,手机,电话查询</div>
<div class="grid_5 alpha ">
  <%= autocomplete_field_tag :key_words,'', autocomplete_by_key_words_customers_url, :id_element => '#quick_link_to_customer_id' %>
  <%= form_for :customer,
        :url => customer_url(:from_autocomplete),
        :html => {
          :method => :get,
          :target => :_blank,
          :id => :quick_search_customer_form
        } do |f|
   %>
   <%= hidden_field_tag :customer_id,'', :id => :quick_link_to_customer_id %>
   <% end %>
   <script type="text/javascript">
     $('#key_words').click(function(){
       $(this).select();
     });
     $('#key_words').bind('keyup',function(event) {
        if(event.keyCode == 13 && $('#quick_link_to_customer_id').val() != ''){
          $('#quick_search_customer_form').submit();
        }
     });
   </script>
</div>